{% extends "djangodemo/base.html" %}

{% block header %}
    <h2>
        {{ topic }}
        <small>
            <a href="{% url 'djangodemo:new_entry' topic.id %}">add new entry</a>
        </small>
    </h2>
{% endblock %}

{% block content %}

    {% for entry in entries %}

        <div class="panel panel-default">
            <div class="panel-heading">
                <h3>
                    {{ entry.date_added|date:'M d,Y H:i' }}
                    <small>
                        <a href="{% url 'djangodemo:edit_entry' entry.id %}">edit entry</a>
                    </small>
                </h3>
            </div>
            <div class="panel-heading">
                {{ entry.text|linebreaks }}
            </div>
        </div>
    {% empty %}
        There are no entries for this topic yet.
    {% endfor %}

{% endblock content %}
